<%@page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>用户管理</title>
    <link href="${pageContext.request.contextPath}/ext3.1/css/ext-all.css" rel="stylesheet" type="text/css" />
	<link href="${pageContext.request.contextPath}/ext3.1/css/ext-patch.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/js/ext-base.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/ext-all.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/js/ext-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/js/ajax.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/js/accredit.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/ux/exttools.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/ux/easygrid.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/ext3.1/ux/error.js"></script>
	<style type="text/css">
		.x-export-excel{
			float:right;
		    background-image:url(${pageContext.request.contextPath}/images/exportExcel.gif);
		    width:52px; height:15px; cursor: pointer; margin:0px 4px;
		}
	</style>
	 <script type="text/javascript">
		var tree_win = null;
		var dic_tree = null;
		var dic_loader = null;
		var add_node_win_;
		var ajaxUrl = "${pageContext.request.contextPath}/user";
		Ext.BLANK_IMAGE_URL = '${pageContext.request.contextPath}/ext3.1/images/default/s.gif';
	 	Ext.QuickTips.init();
	 	Ext.onReady(function(){
	 		var cm;
	 	    var tools1 = [{
		        id:'gear',
		        qtip:"添加用户",
		        handler: function(e, target, panel){
		        		Ext.getCmp('user_win_').show();
	      	}}];
	 	  	var tools2 = [{
		        id:'gear',
		        qtip:"添加角色",
		        handler: function(e, target, panel){
	 	  				Ext.getCmp('role_win_').show();
		    }}];
	      
	       var grid1 = new Ext.grid.EasyGridPanel({
				 id:'grid1',
				 title:'用户列表',
				 key:'orgUserAdapter',
				 width:(all_width-215)*2/3,
				 height:all_height-4,
				 isPage:true,
				 tools:tools1,
				 isForceFit:true,
				 //isRemoteExport:false,
				 callback:function(cm)
	 		 	 {
						cm.setHidden(cm.findColumnIndex ('编号'),true);
						cm.setRenderer(cm.findColumnIndex('是否有效'),function(value,p,record){
							if(record.data.登录名=='admin'){
								return "<img src='${pageContext.request.contextPath}/images/yes0.gif' />";
							}else{
								return value=='true'?"<img style='cursor: pointer;' onclick='enableUser(\""+record.data.编号+"\",false)' src='${pageContext.request.contextPath}/images/yes.gif' />":"<img style='cursor: pointer;' onclick='enableUser(\""+record.data.编号+"\",true)' src='${pageContext.request.contextPath}/images/delete.gif' />";
							}
						});	
						cm.setRenderer(cm.findColumnIndex('操作'),function(value,p,record){
								return "<a style='color:blue; ' href='javascript:void(0);' onclick='showRole(\""+record.data.编号+"\");'>分配角色</a><a style='color:blue;margin-left:25px; ' href='javascript:void(0);' onclick='oldPwd(\""+record.data.编号+"\",\""+record.data.登录名+"\");'>重置密码</a>"+"<a style='color:blue;margin-left:25px; ' href='javascript:void(0);' onclick='changeUser(\""+record.data.编号+"\",\""+record.data.登录名+"\",\""+record.data.真实姓名+"\",\""+record.data.组织机构+"\",\""+record.data.邮箱+"\");'>修改</a>"
								+"<a style='color:blue;margin-left:20px; ' href='javascript:void(0);' onclick='doDeleteUser(\""+record.data.编号+"\");'>删除</a>";
								
						});
						cm.setHidden(cm.findColumnIndex ('组织机构'),true);
						cm.setColumnWidth(cm.findColumnIndex('登录名'),this.width/8);
						cm.setColumnWidth(cm.findColumnIndex('邮箱'),this.width*2/8);
						cm.setColumnWidth(cm.findColumnIndex('真实姓名'),this.width/8);
		    	   		cm.setColumnWidth(cm.findColumnIndex('是否有效'),82);
						cm.setColumnWidth(cm.findColumnIndex('操作'),this.width-this.width*5/8);
	 		 	 }
			 });
	       var grid2 = new Ext.grid.EasyGridPanel({
				 id:'grid2',
				 title:'角色列表',
				 region:'east',
				 collapsible:true,
				 collapsed:false,
				 split: true,
				 margins: '2 2 2 0',
				 key:'orgRoleAdapter',
				 width:(all_width-215)*1/3,
				 height:all_height-4,
				 isPage:true,
				 tools:tools2,
				 //isForceFit:true,
				 baseParams:{init:true},
				 callback:function(cm){
					if(cm.findColumnIndex ('是否授权')<0)
	    	   		{
						cm.setHidden(cm.findColumnIndex('角色编号'),true);
						cm.setColumnWidth(cm.findColumnIndex('角色'),this.width/3);
		    	   		cm.setColumnWidth(cm.findColumnIndex('代码'),this.width/3+50);
		    	   		cm.setColumnWidth(cm.findColumnIndex('操作'),this.width-this.width*2/3-55);
		    	   		cm.setRenderer(cm.findColumnIndex('操作'),function(value,p,record){
		    	   			return '<a href="#" onclick=doDeleteRole("'+record.data.角色编号+'")>删除</a>';
		    	   		})
				    }
	    	   		else
	    	   		{
	    	   			cm.setHidden(cm.findColumnIndex ('用户编号'),true);
	    	   			cm.setRenderer(cm.findColumnIndex ('是否授权'),function(value,p,record)
	    	    	   	{
				    	   		if(record.data.代码 == 'ROLE_USER'){
									return "<input type='checkbox' checked='checked' disabled='disabled' />";
									
				    	   		}else{
			    	   				return value=='1'?"<input type='checkbox' onclick=\"accreditDel('"+record.data.用户编号+"','"+record.data.角色编号+"')\" checked='checked' />":"<input type='checkbox' onclick=\"accreditAdd('"+record.data.用户编号+"','"+record.data.角色编号+"','"+record.data.角色+"','"+record.data.代码+"')\" />";
				    	   		}
						});
	    	   			cm.setColumnWidth(cm.findColumnIndex('角色'),this.width/3);
		    	   		cm.setColumnWidth(cm.findColumnIndex('代码'),this.width/3);
		    	   		cm.setColumnWidth(cm.findColumnIndex('是否授权'),this.width-this.width*2/3-4);	
	    	   		}
	    	   		cm.setHidden(cm.findColumnIndex ('角色编号'),true);
	       		 }
			 });	
			var panel =  new Ext.Panel({
				renderTo:'content',
		        layout: 'border',
		        border:true,
			    width: all_width,
		        height: all_height,
		        items: [{
					id: 'detail',
		            region: 'center',
		            layout:'fit',
		            autoScroll: false,
		            split: true,
		            border:false,
		            margins: '2 2 2 2',
		            items:[grid1]
		         },grid2,{
		            id: 'tree-panel',
		            region: 'west',
		            title: '组织机构',
		            split: true,
		            collapsible: true,
		            height: all_height,
		            width:200,
		            xtype: 'treepanel',
		            margins: '2 0 2 2',
		            autoScroll: true,
			        root: {
				            nodeType: 'async',
				            text: '组织机构',
				            draggable: false,
				            id: '-1'
				    },
				    rootVisible:false,
			        loader: new Ext.tree.TreeLoader({ 
				        		dataUrl: '${pageContext.request.contextPath}/extTree/queryNode.html?key=orgTreeAdapter',
				        		listeners:{beforeload:function(treeLoader, node) {
						      	this.baseParams.id = node.id;
						    }}
					  }),
			         listeners: {
			            'click': function(node,e){
				    	   			Ext.getCmp('ORG_ID_').setValue(node.text);
				    	   			Ext.getCmp('ORG_ID_').code=node.id;
				    	   			Ext.getCmp('ORG_ID_MODIFY').setValue(node.text);
				    	   			Ext.getCmp('ORG_ID_MODIFY').code=node.id;
			                    	Ext.Ajax.request({
				                       method:'post',
									   url: '${pageContext.request.contextPath}/extTree/queryAllChildNodes.html?key=dicOrgIdAdapter',
									   success: function(response,options)
									   {
										   	var res = response.responseText;
										   	grid1.store.baseParams.key = 'orgUserAdapter';
										   	grid1.store.baseParams.id = res;
			                        		grid1.store.load({params:{start:0,limit:20}});
			                        		if(Ext.getCmp('grid2').getParam("init")!=true){
				                        		Ext.getCmp('grid2').setParams({id:null,init:true});
				                        		Ext.getCmp('grid2').reload();
			                        		}
									   },
									   params:{id:node.id}
									});	
			            },
			            //创建右键菜单
		                'contextmenu':function(node,e)
			                {
			                	e.preventDefault();
			                	if(Ext.getCmp('treeMenu') != undefined)
			                	{
			                		Ext.getCmp('treeMenu').destroy();
				                }
			                	var treeMenu = new Ext.menu.Menu( {
							        id : 'treeMenu',
							        items : [ {
							        			id		: 'add',
								                text 	: '添加',
								                icon 	: "${pageContext.request.contextPath}/images/icon/add_tree_node.png",
								                handler : function(){addOrUpdateHandler(node,'add',e);}
								              },{
								              	id		: 'update',
								                text 	: '修改',
								                icon	: "${pageContext.request.contextPath}/images/icon/edit_tree_node.png",
								                handler : function(){addOrUpdateHandler(node,'update',e);}
								              },{
									              	id		: 'delete',
									                text 	: '删除',
									                icon	: "${pageContext.request.contextPath}/images/icon/delete_1.gif",
									                handler : function(){
										                var title ='';
										                var hasChild = false ;
										                var userNum = node.attributes.usernum;
										                var childNum =  node.attributes.childnum;
										                if(childNum > 0){
										                	title = '此组织机构下具有:'+childNum+'个直属子组织机构,如果删除,所有子组织机构及其用户将删除？';
										                	hasChild = true;
											             }
										                else if(userNum > 0){
										                	title = '此组织机构下具有:'+userNum+'个用户,是否一同删除?';
										                	hasChild = true;
										                }
										                else {
															title = '确定删除吗?';
											              }
									                	Ext.Msg.confirm('提示',title,function(btn){
									            	        if(btn == 'yes'){
										            	        var pNode = node.parentNode ;
										            	        Ext.Ajax.request({
									            				   url: ajaxUrl+"/doVirtualDeleteAllChildsByPid.html",
									            				   success:function(response)
									            				   {
									            					   Ext.getCmp('tree-panel').getLoader().load(pNode,function(){pNode.expand();if(pNode.id!=-1)pNode.eachChild(function(n){n.expand();});},this);
									            					   Ext.getCmp('grid1').reload();
									            					   Ext.getCmp('grid2').reload();
									            					   ExtWarning('删除成功');
									            				   },
									            				   params: {ID_:node.id,tableName:'t_org',pidColumnName:'parent_org_id',hasChild:hasChild}
									            				});
									            	        }
									            			else return ;
									            		});
													 }
												 }
							            	]
							    });
								if(node.parent_org_id == '-1')
								{
									treeMenu.items.get("delete").hidden = true;
								}
								
							    coords = e.getXY();
							    treeMenu.showAt(coords);
			                }
			        }
		        }]
		    });//panel布局结束
		    grid1.doLayout();
		    Ext.getCmp('tree-panel').expandAll();

            //修改用户窗口
		    var win_user_modify = new Ext.Window({
			 	  id:'user_win_modify',
				  title:"修改用户",
			      width: 450,
			      height:400,
			      layout: 'fit',
			      plain:true,
			      buttonAlign:'center',
			      closable:false,
			      closeAction:'hide',
			      resizable:false,
			      items:[new Ext.form.FormPanel({
			    	  	frame:true,
			    	  	id:'user_win_form_modify',
						labelWidth:100,
						labelAlign:"right",
						layout:"form",
						width:318,
						height:370,
						bodyStyle:'padding:15px;',
						defaults:{msgTarget:'side',width:200},
						items:[{
								xtype:"textfield",
								id:"LOGIN_NAME_MODIFY",
								fieldLabel:"用户登陆名",
								blankText:'请输入用户登陆名',
								allowBlank:false
							},
							{
								xtype:"textfield",
								id:"REAL_NAME_MODIFY",
								fieldLabel:"真实姓名",
								blankText:'请输入真实姓名',
								allowBlank:false
							},
							{
								xtype:"textfield",
								id:"PASSWORD_MODIFY",
								fieldLabel:"密码",
								blankText:'请输入密码',
								allowBlank:false,
								inputType: 'password'
							},
							{
								xtype:"textfield",
								id:"PASSWORD_REPEAT_MODIFY",
								fieldLabel:"确认密码",
								blankText:'请输入确认密码',
								allowBlank:false,
								inputType: 'password',
								vtype:'password',
								vtypeText:'两次密码不一致',
								confirmTo:'PASSWORD_MODIFY'
							},
							{
								xtype:"textfield",
								id:"EMAIL_MODIFY",
								fieldLabel:"E-MAIL",
								vtypeText:'邮箱格式不正确',
								allowBlank:false,
								blankText:'请输入邮箱',
								vtype:'email'
							},
							{
								xtype:"textfield",
								fieldLabel:"组织结构",
								readOnly:true,
								id:'ORG_ID_MODIFY',
								allowBlank:false,
								blankText:'请选择所属组织结构',
								emptyText:'请选择所属组织结构'
							}]
							})],
							buttons:[{
								xtype:"button",
								text:"确认修改",
								handler:function(){
									Ext.Ajax.request({
										url:'${pageContext.request.contextPath}/user/modifyUser.html',
										method:'post',
									 	success: function(response,options){
								 			Ext.getCmp('grid1').reload();
								 			win_user_modify.hide();
									 	},
									 	params:{
											login_name_:Ext.getCmp('LOGIN_NAME_MODIFY').getValue().trim(),
											real_name_:Ext.getCmp('REAL_NAME_MODIFY').getValue().trim(),
											org_id_:Ext.getCmp('ORG_ID_MODIFY').code.trim(),
											email_:Ext.getCmp('EMAIL_MODIFY').getValue().trim(),
											user_id_:main_id
									 	}
									});
								}
							},{
								xtype:"button",
								text:"取消",
								handler:function(){
									Ext.getCmp("user_win_form_modify").form.reset();
									win_user_modify.hide();
							    }
							}]
					});
		});//Ext_onReady结束
		//添加子节点或者修改所选节点
		function addOrUpdateHandler(node,operate,e)
		{
			var node_id_ ;
			var node_name_ ;
			var node_label_ ;
			var node_desc_ ;
			var node_position_;
			
			if(operate == "update")
			{
				node_id_ = node.id;
				node_label_ = node.text;
				node_name_ = node.attributes.name;
				node_desc_= (node.attributes.description == "null"?"":node.attributes.description);
				node_position_ = node.attributes.position;
			}
			if(add_node_win_ != null)
			{
				add_node_win_.close();
			}
			var addOrUpdateNodeForm = new Ext.form.FormPanel({
				id:"addOrUpdateNodeForm",
				labelWidth:90,
				labelAlign:"right",
				layout:"form",
				width:250,
				height:440,
				bodyStyle:'padding:10px;',
				defaults:{msgTarget:'side'},
				items:[
					{
						xtype:"textfield",
						id:"NAME_",
						name:"NAME_",
						fieldLabel:"名称",
						value:node_name_,
						allowBlank:false,
						blankText:'名称不能为空'
					}
					,{
						xtype:"textfield",
						id:"LABEL_",
						name:"LABEL_",
						fieldLabel:"别名",
						value:node_label_,
						allowBlank:false,
						blankText:'别名不能为空'
					}
					,{
						xtype:"textfield",
						id:"DESCRIPTION_",
						name:"DESCRIPTION_",
						fieldLabel:"描述",
						value:node_desc_
					}
					,{
						xtype:"numberfield",
						id:"POSITION_",
						name:"POSITION_",
						fieldLabel:"顺序",
						value:node_position_,
						allowBlank:false,
						blankText:'顺序不能为空,值不能小于0'
					}
				]
				,buttons:[	
					{
						xtype:"button",
						text:"确 定",
						handler:function()
						{
							var dic_org_name = Ext.getCmp("NAME_").getValue();
							var dic_org_label = Ext.getCmp("LABEL_").getValue();
							var dic_org_desc = (Ext.getCmp("DESCRIPTION_").getValue()=="null"?"":Ext.getCmp("DESCRIPTION_").getValue());
							var dic_org_position = Ext.getCmp("POSITION_").getValue();
							if(!Ext.getCmp("NAME_").validate()||!Ext.getCmp("LABEL_").validate()||!Ext.getCmp("POSITION_").validate())
							{
								return;
							}
							else if(dic_org_position < 0)
							{
								return;
							}
							else
							{
								var tree_params;
								if(operate == "add")
								{
									tree_params = {PARENT_ORG_ID:node.id,NAME_:dic_org_name,LABEL_:dic_org_label,DESCRIPTION_:dic_org_desc,POSITION_:dic_org_position,IS_AJAX_:'true',Constant_TableName_:'t_org'};
								}
								else if(operate == "update")
								{
									tree_params = {Constant_TableName_:'t_org',ID_:node_id_,IS_AJAX_:'true',NAME_:dic_org_name,LABEL_:dic_org_label,DESCRIPTION_:dic_org_desc,POSITION_:dic_org_position}
								}
								
								//ajax添加方法
								Ajax.add({
									success: function(response,options)
								   	{
									   	var res = response.responseText;
									   	var resJson = Ext.util.JSON.decode(res);
									   	//得到要展开的节点
									   	var expandNode ;
									   	if(operate == "add")
										{
											expandNode = node;
										}
										else if(operate == "update")
										{
											expandNode = node.parentNode;
										}
										//判断要展开节点数据是否已加载。如果数据没加载,直接展开;否则，先load再展开
									   	if(expandNode.childrenRendered)
									   	{
											Ext.getCmp("tree-panel").getLoader().load(expandNode);	
									   	}
										expandNode.expand(false, false);
								   	},
								   	params:tree_params
								});
								
								//关闭窗口
								add_node_win_.close();
							}
						}
					}
					,{
						xtype:"button",
						text:"关  闭",
						handler:function()
						{
							add_node_win_.close();
						}
					}
				]
			});//FormPanel结束
			add_node_win_ = new Ext.Window({
				title:"添加/修改组织结构",
				width: 270,
				height:350,
				layout: 'fit',
				plain:true,
				closeAction:'hide',
				buttonAlign:'center',
				closable:false,
				resizable:false,
				items: addOrUpdateNodeForm
		  	});
			var coords = e.getXY();
			add_node_win_.setPosition(coords[0]+10,coords[1]);
		    add_node_win_.show();
		}
		//根据组织机构查询用户列表
		function showRole(id){
			Ext.getCmp('grid2').expand(false);
			Ext.getCmp('grid2').setParams({id:id,init:null});
			Ext.getCmp('grid2').parseHeader = true;
			Ext.getCmp('grid2').load();
		}
		//设置用户是否有效
		function enableUser(id_,enabled_){
			Ext.Ajax.request({
				url:"${pageContext.request.contextPath}/user/updateEnableForUser.html",
				method:'post',
			 	success: function(response,options){
			 		Ext.getCmp('grid1').reload();
			 	},
			 	failure: function(res){
				 	  Ext.Msg.show({
				 		 title:'出错了!',
						   msg: res.responseText,
						   buttons: {ok:'确定'},
						   icon: Ext.MessageBox.ERROR,
						   maxWidth :300,
						   minWidth :300,
						   closable:false,
						   defaultTextHeight :100
					  });
			 	},
			 	params:{
			 		id_:id_,
			 		enabled_:enabled_
			 	}
			});
		}
		//增加授权
		function accreditAdd(userid,roleid,roleName,roleCode){
			Ext.Ajax.request({
				url:"${pageContext.request.contextPath}/user/addRoleForUser.html",
				method:'post',
			 	success: function(response,options){
			 		Ext.getCmp('grid2').reload();
			 	},
			 	failure: function(res){
				 	  Ext.Msg.show({
				 		 title:'出错了!',
						   msg: res.responseText,
						   buttons: {ok:'确定'},
						   icon: Ext.MessageBox.ERROR,
						   maxWidth :300,
						   minWidth :300,
						   closable:false,
						   defaultTextHeight :100
					  });
			 	},
			 	params:{
					USER_ID_:userid,
					ROLE_ID_:roleid,
					ROLE_NAME_:roleName,
					ROLE_CODE_:roleCode
			 	}
			});
		}
		//重置密码
		function oldPwd(id,user_name_){
			Ext.MessageBox.confirm('提示：','是否重置密码？',function(btn){
				if(btn=='yes'){
					Ext.Ajax.request({
						url:getRootPath()+"/user/resetPwd.html",
						method:'post',
					 	success: function(response,options){
							if(response.responseText.trim()!=''){
						 		Ext.Msg.show({
						 			title:'出错了!',
									msg: response.responseText,
									buttons: {ok:'确定'},
									icon: Ext.MessageBox.ERROR,
						 		   maxWidth :300,
						 		   minWidth :300,
						 		   closable:false,
						 		   defaultTextHeight :100
								});
						 		return;
							}
							Ext.Msg.show({
								title:'提示',
								msg: '<b>修改成功!</b>',
								 buttons: {ok:'确定'},
								icon: Ext.MessageBox.INFO,
								   maxWidth :300,
								   minWidth :300,
								   closable:false,
								   defaultTextHeight :100
							});
					 	},
					 	failure: function(res){
					 		Ext.Msg.show({
					 			 title:'出错了!',
								   msg: res.responseText,
								   buttons: {ok:'确定'},
								   icon: Ext.MessageBox.ERROR,
					 		   maxWidth :300,
					 		   minWidth :300,
					 		   closable:false,
					 		   defaultTextHeight :100
							  });
					 	},
					 	params:{
					 		id_:id,
					 		password_new_:'111111'
					 	}
					});
				}
			});
		}
		//删除授权
		function accreditDel(userid,roleid){
			Ext.Ajax.request({
				url:"${pageContext.request.contextPath}/user/delRoleForUser.html",
				method:'post',
			 	success: function(response,options){
			 		Ext.getCmp('grid2').reload();
			 	},
			 	failure: function(res){
				 	  Ext.Msg.show({
				 		 title:'出错了!',
						   msg: res.responseText,
						   buttons: {ok:'确定'},
						   icon: Ext.MessageBox.ERROR,
						   maxWidth :300,
						   minWidth :300,
						   closable:false,
						   defaultTextHeight :100
									 	  
					  });
			 	},
			 	params:{
					USER_ID_:userid,
					ROLE_ID_:roleid
			 	}
			});
		}
        //修改用户信息
		function changeUser(id,loginName,realName,org,email)
		{
			Ext.Ajax.request({
				   url: "${pageContext.request.contextPath}/user/findOrgId.html",
				   success:function(response)
				   {
					    main_id=id;
				        Ext.getCmp("ORG_ID_MODIFY").setValue(response.responseText);
						Ext.getCmp('user_win_modify').setTitle("修改用户信息");
						Ext.getCmp("LOGIN_NAME_MODIFY").setValue(loginName);
						Ext.getCmp("REAL_NAME_MODIFY").setValue(realName);
						Ext.getCmp("EMAIL_MODIFY").setValue(email);
						Ext.getCmp("PASSWORD_MODIFY").setValue("123456789");
						Ext.getCmp("PASSWORD_REPEAT_MODIFY").setValue("123456789");
						Ext.getCmp("PASSWORD_REPEAT_MODIFY").setDisabled(true) ;
						Ext.getCmp("PASSWORD_MODIFY").setDisabled(true);
						Ext.getCmp('ORG_ID_MODIFY').code=org;
						Ext.getCmp('user_win_modify').show();
				   },
				   params: { userId: id }
				});							
		}

		//删除用户
		function doDeleteUser(id){
			Ext.Ajax.request({
			   url: ajaxUrl+"/doVirtualDelete.html",
			   success:function(response)
			   {
				   Ext.getCmp('grid1').reload();
				   ExtWarning('删除成功');
			   },
			   params: {ID_:id,tableName:'t_users'}
			});
		}
		//假删除角色
		function doDeleteRole(id){
			Ext.Ajax.request({
			   url: ajaxUrl+"/doVirtualDelete.html",
			   success:function(response)
			   {
				   Ext.getCmp('grid2').reload();
				   ExtWarning('删除成功');
			   },
			   params: {ID_:id,tableName:'t_role'}
			});
		}
	 </script>
	 
</head>
<body>
	${Constant_MESSAGE_FOR_ADMIN_ }
</body>
</html>